package com.hjy.util;

import cn.hutool.core.io.FileUtil;
import com.hjy.view.View1;

import java.io.File;

/**
 * @author: hujingyu
 * @create: 2024/4/25 15:28
 */
public class FileCreateUtil {

    private static  String url = "" ;

    static {
        String jarPath = View1.class.getProtectionDomain().getCodeSource().getLocation().getPath();
        File fileJAR = FileUtil.file(jarPath);
        url = fileJAR.getParent();
    }

    public static void createDir(String dirUrl) {
        dirUrl = url + dirUrl;
        File file = FileUtil.file(dirUrl);
        if (!file.exists()) {
            file.mkdir();
        }
    }
}
